package com.song.cloud.nacos.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.net.URI;

/**
 * @Author ZhangGuisong
 * @Date 2021/2/27-14:45
 */
@RestController
public class nacosController {
    private String url="http://nacos-provider-service";
    @Value("${server.port}")
    private String serverPort;
    @Autowired
    private RestTemplate restTemplate;
    @GetMapping("/nacos/consumer/getInfo")
    public String getInfo(){

       return restTemplate.getForObject(url+"/nacos/provider/getInfo",String.class);
    }
}
